// Below of the comment block
(function (J, c) {
    var W = J.location.href,
        B = c.getElementById("dcm_comments-block"),
        z = c.getElementById("dcm_emo-bar"),
        A = c.getElementById("dcm_comments-total"),
        F = c.getElementById("dcm_comments-pager"),
        E = c.getElementById("dcm_comments-css"),
        y = c.getElementById("comment-editor"),
        q = c.getElementById("dcm_form-comment-button-cancel"),
        C = B.getElementsByClassName("button-reply"),
        t = y.src.split("#"),
        a = B.innerHTML,
        S = [],
        G = [],
        v = [],
        m = 0,
        H = "",
        b = "",
        D = "",
        R = 0,
        Q = 0,
        P = 0,
        O = 0,
        x = "",
        w = "",
        u = "";
    J.dcm_Cm = function (g, f) {
        var e = f,
            d = " <i data-emo='http://dcm404.googlecode.com/svn/trunk/dcm/emo/",
            h = "' class='emo'></i>";
        e = e.replace(/^(<br ?\/?>|&nbsp;)+/i, "").replace(/(<br ?\/?>)+(:|;|\^|=)/ig, "<br> $2").replace(/^(&nbsp;|<br ?\/?>| <br ?\/?>)+/ig, "").replace(/\@<a href="\#c([0-9]+)\"( rel="nofollow")?>.*?<\/a>\:? ?/g, "").replace(/\s:\)/g, d + "smile-1.gif' title=':)" + h).replace(/\s;\)/g, d + "wink.gif' title=';)" + h).replace(/\s:D/g, d + "haha.gif' title=':D" + h).replace(/\s=D/g, d + "hihi.gif' title='=D" + h).replace(/\s\^:D/g, d + "above-me-haha.gif' title='^:D" + h).replace(/\s\^\_?\^/g, d + "smile-2.gif' title='^_^" + h).replace(/\s:\(/g, d + "sad.gif' title=':(" + h).replace(/\s=\(/g, d + "sad-2.gif' title='=(" + h).replace(/\s@@,/g, d + "roll-eyes.gif' title='@@," + h).replace(/\s:yaya:/ig, d + "ya.gif' title=':yaya:" + h).replace(/\s:s/ig, d + "sullen.gif' title=':s" + h).replace(/\s:(\\|\/)/ig, d + "um.gif' title=':&#92;" + h).replace(/\s:('|\&\#39\;)\(/g, d + "cry.gif' title=':&#39;(" + h).replace(/\s:waaa:/ig, d + "wa.gif' title=':waaa:" + h).replace(/\sT\_T/ig, d + "tear.gif' title='T_T" + h).replace(/\sB\)/g, d + "cool.gif' title='B)" + h).replace(/\s:Q/g, d + "smoking.gif' title=':Q" + h).replace(/\s\*\*p/ig, d + "crazy.gif' title='**p" + h).replace(/\s7:\(/g, d + "confuse.gif' title='7:(" + h).replace(/\s(:|=)p\*/ig, d + "playing-2.gif' title='=p*" + h).replace(/\s:p/ig, d + "we.gif' title=':p" + h).replace(/\s:Oz+/ig, d + "sleep.gif' title=':Ozz" + h).replace(/\s7:O/ig, d + "angry-1.gif' title='7:O" + h).replace(/\s\\o\//ig, d + "applause.gif' title='&#92;o/" + h).replace(/\s\\m\//ig, d + "metal.gif' title='&#92;m/" + h).replace(/\s(&lt;3|:\*)/g, d + "love.gif' title='&amp;amp;lt;3" + h).replace(/\s0:\)/g, d + "angel-green.gif' title='0:)" + h).replace(/\s\^o\^/ig, d + "angel-white.gif' title='^o^" + h).replace(/\s:\-a/ig, d + "vomit.gif' title=':-a" + h).replace(/\s\*fck\*/ig, d + "fuck.gif' title='*fck*" + h).replace(/\sxV/ig, d + "shout.gif' title='xV" + h).replace(/\sx@/g, d + "angry-2.gif' title='x@" + h).replace(/\sX@/ig, d + "argh.gif' title='X@" + h).replace(/\s:\-d/g, d + "top-top.gif' title=':-d" + h).replace(/\s:\-bd/g, d + "top.gif' title=':-bd" + h).replace(/\s\~x\(+/ig, d + "ugh.gif' title='~x(" + h).replace(/\s:bye:/ig, d + "bye.gif' title=':bye:" + h).replace(/\s:W/g, d + "explain.gif' title=':W" + h).replace(/\s\(\-\.\-,\)/g, d + "pumpkin.gif' title='(-.-,)" + h).replace(/\s\*=p/ig, d + "playing-1.gif' title='*=p" + h).replace(/\s:(i-am-here|di-sini):/ig, d + "i-am-here.gif' title=':disini:" + h).replace(/\s:cendol:/ig, d + "cendol.gif' title=':cendol:" + h).replace(/\s&lt;:\)/g, d + "festival-1.gif' title='&amp;amp;lt;:)" + h).replace(/\s&lt;=\)/g, d + "festival-2.gif' title='&amp;amp;lt;=)" + h).replace(/\s:(rolled|guling):/ig, d + "rolled.gif' title=':guling:" + h).replace(/\s\*bang\*/ig, d + "bang.gif' title='*bang*" + h).replace(/\s\'\'J/ig, d + "call.gif' title='&#39;&#39;J" + h).replace(/\s:(drum|drummer):/ig, d + "drum.gif' title=':drummer:" + h).replace(/\s:(guitarist|gitaris|guitar|gitar):/ig, d + "guitar.gif' title=':gitaris:" + h).replace(/\s:(vocalist|vokalis):/ig, d + "vocal.gif' title=':vokalis:" + h).replace(/\[note\](.*?)\[\/note\]/ig, "<div class='note'>$1</div>").replace(/\[(youtube|iframe)\](.*?)\[\/(youtube|iframe)\]/ig, "<div class='fluid-video loader'><iframe class='video' data-src='$2' frameborder='0'></iframe></div>").replace(/<em rel="note">(.*?)<\/em>/ig, "<div class='note'>$1</div>").replace(/<i rel="code">(.*?)<\/i>/ig, "<code>$1</code>").replace(/<b rel="h([0-6])">(.*?)<\/b>/ig, "<h$1>$2</h$1>").replace(/<i rel="anchor">(.*?)<\/i>/ig, "<a class='allow' href='$1' rel='nofollow'>$1</a>").replace(/\[(link|url)\](.*?)\[\/(link|url)\]/ig, "<a class='allow' href='$2' rel='nofollow'>$2</a>").replace(/\[url\=('|")?(.*?)('|")?\](.*?)\[\/url\]/ig, "<a class='allow' href='$2' rel='nofollow'>$4</a>").replace(/(<i rel="image">|\[img\])(.*?)(<\/i>|\[\/img\])/ig, "<img class='center img-attachment' data-src='$2' alt='Loading...'>").replace(/<\/h([0-6])>(<br ?\/?>)+/g, "</h$1>");
        g.innerHTML = e
    };
    if (!B || !z || !A || !F || !E) {
        return
    }

    function s() {
        var e = -1;
        if (navigator.appName == "Microsoft Internet Explorer") {
            var d = navigator.userAgent;
            var f = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
            if (f.exec(d) !== null) {
                e = parseFloat(RegExp.$1)
            }
        }
        return e
    }
    var V = s();
    if (V == -1 || V >= 9) {
        while (a.search(/<div id\=\"c[0-9]+/) != -1) {
            Q = a.indexOf('id="c');
            a = a.substring(Q + 4);
            Q = a.indexOf('"');
            S[m] = a.substring(0, Q);
            a = a.substring(Q);
            if (/c[0-9]+/.test(S[m]) && document.getElementById(S[m])) {
                G[m] = c.getElementById(S[m]).innerHTML;
                v[m] = 0;
                m++
            }
        }
        for (Q = 0; Q < m - 1; ++Q) {
            for (P = Q + 1; P < m; ++P) {
                if (G[P].indexOf(S[Q]) != -1) {
                    H = S[P];
                    b = G[P];
                    v[P] = v[Q] + 1;
                    D = v[P];
                    for (R = Q + 1; R < P; ++R) {
                        if (v[R] < D) {
                            break
                        }
                    }
                    for (O = P; O > R; O = O - 1) {
                        S[O] = S[O - 1];
                        G[O] = G[O - 1];
                        v[O] = v[O - 1]
                    }
                    S[R] = H;
                    G[R] = b;
                    v[R] = D
                }
            }
        }
        for (Q = 0; Q < m; ++Q) {
            P = G[Q].indexOf('dcm_comment-body">@<a class="allow" href="#c');
            if (P != -1) {
                w = G[Q].substring(0, P + 18);
                u = G[Q].substring(P + 1);
                P = u.indexOf("</a>");
                u = u.substring(P + 4);
                G[Q] = w + u
            }
            P = G[Q].indexOf('class="dcm_comment ');
            if (P != -1) {
                w = G[Q].substring(0, P);
                u = G[Q].substring(P);
                if (v[Q] > 5) {
                    v[Q] = 5
                }
                G[Q] = w + 'style="margin-left:' + (v[Q] * 5) + '%;" ' + u
            }
            x += G[Q]
        }
        dcm_Cm(B, x);
        B.style.visibility = "visible";
        var U = A.innerHTML,
            M = parseInt(U, 10);
        if (M > 200) {
            x = '<div class="pull-left">Halaman ';
            var T = (M - M % 200) / 200 + 1,
                L = "",
                K = 1;
            Q = W.indexOf(".html");
            if (Q != -1) {
                L = W.substring(0, Q + 5)
            } else {
                L = W
            }
            Q = L.indexOf("#dcm_comments");
            if (Q != -1) {
                L = L.substring(0, Q)
            }
            Q = W.indexOf("?commentPage=");
            if (Q == -1) {
                K = 1
            } else {
                K = parseInt(W.substring(Q + 13), 10)
            }
            for (Q = 1; Q <= T; ++Q) {
                if (Q == K) {
                    x += "<span>" + Q + "</span>"
                } else {
                    x += '<a href="' + L + "?commentPage=" + Q + '#dcm_comments">' + Q + "</a>"
                }
            }
            if (K * 200 <= M) {
                x += '</div><div class="pull-right">' + (((K - 1) * 200) + 1) + " - " + (K * 200) + " dari " + M + " Komentar</div>"
            } else {
                x += '</div><div class="pull-right">Halaman Terakhir</div>'
            }
            F.innerHTML = x;
            F = c.getElementById("dcm_comments-pager-copy");
            F.innerHTML = x;
            if (K < T) {
                x = "";
                E.innerHTML = x
            }
        }
    } else {
        dcm_Cm(B, "<h4><em>Old IE Suck!</em></h4>")
    }
    dcm_Cm(z, z.innerHTML);
    J.dcm_r = function (e) {
        if (!y) {
            return
        }
        var d = c.getElementById((e != "cancel" ? "cp" + e : "dcm_comments"));
        y.src = (e != "cancel") ? t[0] + "&parentID=" + e + "#" + t[1] : t.join("#");
        y.className += " transparent";
        y.parentNode.className += " loader";
        y.onload = function () {
            this.className = this.className.replace(/ transparent/g, "");
            this.parentNode.className = this.parentNode.className.replace(/ loader/g, "")
        };
        d.insertBefore(y.parentNode.parentNode, null)
    };
    if (c.getElementsByClassName) {
        for (var I = 0, N = C.length; I < N; ++I) {
            C[I].href = 'javascript:dcm_r("' + C[I].getAttribute("data-rt") + '");'
        }
    }
    if (q) {
        q.setAttribute("onclick", 'javascript:dcm_r("cancel")')
    }
})(window, document);